import type { Metadata } from "next"
import { Analytics } from "@vercel/analytics/react"
import { Inter, JetBrains_Mono } from "next/font/google"
import { ThemeProvider } from "@/providers/ThemeProvider"
import Loader from "@/components/Loader"
import Header from "@/components/layouts/header"
import CustomCursor from "@/components/CustomCursor"
import ClientOnly from "@/components/ClientOnly"
import "./globals.css"

const inter = Inter({ subsets: ["latin"] })
const jetbrainsMono = JetBrains_Mono({ 
  subsets: ["latin"],
  variable: "--font-mono"
})

export const metadata: Metadata = {
  metadataBase: new URL('https://midoyun.com'),
  title: "蜜多云科技 - 大家居AI数字营销陪跑领先服务商",
  description: "专注大家居行业，提供AI驱动的数字营销解决方案。5年深度服务经验，服务100+品牌，覆盖10000+终端门店。",
  applicationName: "蜜多云科技官网",
  openGraph: {
    type: "website",
    url: "https://midoyun.com/",
    title: "蜜多云科技 - 大家居AI数字营销陪跑领先服务商",
    description: "专注大家居行业，提供AI驱动的数字营销解决方案。让AI智能体懂企业的业务。",
    siteName: "蜜多云科技",
    images: [
      {
        url: "/og-image.jpg",
      },
    ],
  },
  authors: {
    name: "蜜多云科技",
  },
  generator: "NextJs",
  keywords: [
    "蜜多云", 
    "AI数字营销", 
    "大家居", 
    "瓷砖行业", 
    "智能营销", 
    "数字化转型",
    "营销陪跑",
    "AI智能体"
  ],
  creator: "蜜多云科技",
  icons: {
    icon: "/favicon.png",
  },
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  return (
    <html lang="zh-CN" suppressHydrationWarning>
      <Analytics />
      <body 
        className={`${inter.className} ${jetbrainsMono.variable}`}
        suppressHydrationWarning
      >
        <ClientOnly>
          <Loader />
          <CustomCursor />
        </ClientOnly>

        <ThemeProvider
          attribute="class"
          defaultTheme="light"
          enableSystem
          disableTransitionOnChange
        >
          <Header />
          {children}
        </ThemeProvider>
      </body>
    </html>
  )
}
